home *** CD-ROM | disk | FTP | other *** search
- Path: chronicle.mti.sgi.com!austern
- From: abell@mindspring.com (Andrew Bell)
- Newsgroups: comp.std.c++
- Subject: Re: Quick questions
- Date: 01 Apr 1996 10:16:18 PST
- Organization: MindSpring Enterprises
- Approved: austern@isolde.mti.sgi.com
- Message-ID: <4jnj9d$1jc8@mule1.mindspring.com>
- References: <4j5b26$1e7a@mule1.mindspring.com> <4j7a64$l9i@engnews1.Eng.Sun.COM> <4jajk2$17aq@mule1.mindspring.com> <KANZE.96Mar28102433@gabi.gabi-soft.fr>
- NNTP-Posting-Host: isolde.mti.sgi.com
- X-Original-Date: Mon, 01 Apr 1996 03:44:03 GMT
- X-Newsreader: Forte Agent .99.82
- X-Auth: PGPMoose V1.1 PGP comp.std.c++
- iQBVAwUBMWAddEy4NqrwXLNJAQGQhgIAvk/vXnMLWGHcRYkPQf0TPGHhMx60mqMx
- Et/tx6i0DPcsSRwYaUHgyCpwZdZLnfx83Q7w+QTHG4Xs1BGern5pHw==
- =Uy1B
- Originator: austern@isolde.mti.sgi.com
-
- kanze@gabi-soft.fr (J. Kanze) wrote:
- >You have it the other way. The conversion operator is called a
- >constructor. Thus, to take a concrete example (based on the deleted
- >parts of your posting (`stat' is a struct defined by Posix):
-
- > class FileStat : stat
- > {
- > public :
- > FileStat( stat const& other ) ;
- > // ...
- > } ;
-
- That's fine when your base class is a small thing; not so good when
- you're dealing with a large bitmap or (in my case) a Windows OLE
- variant structure, or if you want it passed as a non-const parm. Few
- compilers would do the implicit conversion without creating a
- temporary; none would do so if we have any logic at all in the
- constructor, for example if our derived class shouldn't apply to all
- versions of the base class.
-
- Andrew Bell
- abell@mindspring.com
- ---
- [ comp.std.c++ is moderated. To submit articles: Try just posting with your
- newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
- comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
- Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
- Comments? mailto:std-c++-request@ncar.ucar.edu
- ]
-